package org.springblade.modules.notice.core.mq;

import cn.hutool.core.date.DateUtil;
import com.github.thierrysquirrel.annotation.CommonMessage;
import com.github.thierrysquirrel.annotation.RocketMessage;
import com.github.thierrysquirrel.annotation.StartDeliverTime;
import com.github.thierrysquirrel.core.producer.MessageSendType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


/**
 * @Author ysq
 * @Date 2024/12/04
 * @Description 延时消息生产者
 */
@Slf4j
@Component
@RocketMessage(groupID = "GID_DELAY_MSG")
public class DelayNoticeProduce {

	@CommonMessage(topic = "delay_msg", messageSendType = MessageSendType.SEND_ASYNC)
	public String send(@StartDeliverTime long startDeliverTime, String message) {
		log.info("延迟消息通知,发送时间:[{}], 发送内容:[{}]", DateUtil.now(), message);
		return message;
	}
}
